import request from '@/utils/request'
/**
 * 登录
 * @param params
 */
//  export function login(params) {
//     let obj = new URLSearchParams()
//     for (let i in params) {
//       obj.append(i, params[i])
//     }
//     return request({
//       url: '/user/login',
//       method: 'post',
//       data: obj,
//       headers: {
//         'Content-Type': "application/x-www-form-urlencoded"
//       }
//     })
//   }
export function login(params) {
  return request({
    url: '/user',
    method: 'GET',
    params: params
  })
}
export const  getUserList = (params) => request({
  url: '/userList',
  method: 'GET',
  params: params
})
export const deleteUser = (params) => request({
  url: '/user',
  method: 'DELETE',
  params: params
})
export const updateUser = (params) => request({
  url: '/user',
  method: 'PUT',
  data: params
})
/**
 * 注册
 * @param params
 */
  export function register(params) {
    return request({
      url: '/user',
      method: 'post',
      data: params
    })
  }
